package com.doujiao.auth.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.doujiao.auth.dto.AdminLogPageDTO;
import com.doujiao.auth.service.AdminLogService;
import com.doujiao.core.Result;
import com.doujiao.core.auth.entity.AdminLog;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 管理员日志控制器
 * </p>
 *
 * @author wuyunbin
 * @since 2025-05-24
 */
@Tag(name = "管理员日志")
@RestController
@RequestMapping("/admin/log")
@RequiredArgsConstructor
public class AdminLogController {

    private final AdminLogService adminLogService;

    /**
     * 分页查询管理员日志
     *
     * @param dto 查询参数
     * @return 分页结果
     */
    @Operation(summary = "分页查询管理员日志")
    @PostMapping("/page")
    public Result<IPage<AdminLog>> page(@RequestBody AdminLogPageDTO dto) {
        return Result.success(adminLogService.page(dto));
    }
}
